home *** CD-ROM | disk | FTP | other *** search
- Path: news.bs.tpl.net!news
- From: Dieter Lⁿcking <luecking@braunschweig.netsurf.de>
- Newsgroups: comp.lang.c++
- Subject: Help:ostrstream,strstreambuf
- Date: Thu, 04 Apr 1996 20:47:57 +0100
- Organization: IRD Daten- und Netzwerktechnik
- Message-ID: <3164276D.5FD0@braunschweig.netsurf.de>
- NNTP-Posting-Host: plueckin.braunschweig.netsurf.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- I attempt to implement a stream for message boxes.
- First the example:
-
- class MessageBuffer : public strstreambuf
- {
- public:
- MessageBuffer()
- : strstreambuf()
- {}
-
- // ... more constructors
-
- virtual int sync() // *** First question *** //
- {
- // Target specific implementation.
- // A simple example:
- cout << this; return __NOT_EOF;
- }
- };
-
- class Message : public ostrstream
- {
- public:
- Message()
- : ostrstream()
- { init(new MessageBuffer); } // *** Second question ***
- //
-
- // ... more constructors
- };
-
- First question:
- The function sync() should only executed if ostream::flush() is called.
- However
- i am not sure. Are there any side effects ?
-
- Second question:
- Deletes ~ios() any the streambuffer object or is it a job for ~Message()
- ?
-
- Thanks
- Dieter Luecking
-
-